package com.abc.springboot.service.impl;

import com.abc.springboot.mapper.StudentMapper;
import com.abc.springboot.pojo.MyList;
import com.abc.springboot.pojo.Student;
import com.abc.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> queryStudent() {
        List<Student> list=studentMapper.selectStudent();
        return list;
    }

    @Override
    public Student queryStudentById(int id) {
        return studentMapper.selectStudentById(id);
    }

    @Override
    public Student queryStudentByName(String name) {
        return studentMapper.selectStudentByName(name);
    }

    @Override
    public Student queryStudentByPhonenumber(long phonenumber) {
         return studentMapper.selectStudentByPhonenumber(phonenumber);
    }

    @Override
    public void addAStudent(Student student) {
        studentMapper.insertAStudent(student);
    }

    @Override
    public void addStudents(List<Student> list) {
        studentMapper.insertStudents(list);
    }
}
